package com.dzl.moive.service;


import com.dzl.base.service.BaseService;
import com.dzl.moive.pojo.WelfareMovieOrder;
import com.dzl.moive.pojo.dto.WelfareMovieOrderPayDto;
import com.dzl.moive.pojo.dto.WelfareMovieOrderRefundDto;
import com.dzl.moive.pojo.dto.WelfareMovieOrderSaveDto;
import com.dzl.moive.pojo.query.WelfareMovieOrderListQuery;
import com.dzl.moive.pojo.query.WelfareMovieOrderQuery;
import com.dzl.moive.pojo.vo.WelfareMovieOrderInfoVo;
import com.dzl.moive.pojo.vo.WelfareMovieOrderListVo;
import com.dzl.moive.pojo.vo.WelfareMovieOrderPayVo;
import com.dzl.moive.pojo.vo.WelfareMovieOrderVo;
import com.dzl.userwx.pojo.WelfareUserWx;
import com.github.pagehelper.PageInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

/**
 * 电影订单(welfare_movie_order)服务接口
 * @author liuguanjun
 * @date 2021-11-02 11:11:02
 */
public interface WelfareMovieOrderService extends BaseService<WelfareMovieOrder> {

    /**
     * 创建电影订单
     * @param welfareOrderSaveDto 生成订单传参
     * @author liuguanjun
     * @date 2021-11-02 16:38:50
     **/
    Integer createMovieOrder(WelfareMovieOrderSaveDto welfareOrderSaveDto) throws UnsupportedEncodingException;

    /**
     * 分页查询电影票订单数据列表
     * @author liuguanjun
     * @date 2021-11-06 09:56:30
     * @param query 查询条件
     **/
    PageInfo<WelfareMovieOrderVo> getWelfareMovieOrderVoListPage(WelfareMovieOrderQuery query);

    /**
     * 电影订单流水顶部状态栏数量
     * @date 2021/11/5 10:39
     * @author caobucao
     * @param query 查询条件
     * @return java.util.List<java.lang.Integer>
     */
    List<Integer> getMovieOrderCount(WelfareMovieOrderListQuery query);

    /**
     * 分页查询电影订单列表
     * @date 2021/11/06 10:15
     * @author ChenLong
     * @param query 查询条件
     */
    PageInfo<WelfareMovieOrderListVo> getMovieOrderVoPage(WelfareMovieOrderListQuery query);

    /**
     * 获取电影票订单详情
     * @param orderId 电影订单id
     * @author liuguanjun
     * @date 2021-11-06 10:35:30
     **/
    WelfareMovieOrderVo getMovieOrderDetail(Integer orderId);

    /**
     * 取消电影订单
     * @param tradeno 订单号
     * @author liuguanjun
     * @date 2021-11-04 14:33:50
     **/
    Boolean cancelMovieOrder(String tradeno, String cancelRemark);

    /**
     * 查询15分钟内未支付订单
     * @date 2021/11/05 17:44
     * @author liuguanjun
     */
    List<WelfareMovieOrder> selectUnpaidMovieOrder();

    /**
     * 获取用户有效期内未支付的订单
     * @param mobile 用户手机号
     * @author liuguanjun
     * @date 2021-11-04 14:43:50
     **/
    String getUnpaidMovieOrder(String mobile);

    /**
     * 获取电影订单支付卡默认匹配结果
     * @param userId  用户id
     * @param orderId 订单id
     * @param cardSecretId 卡密id
     * @return java.util.Map
     * @author liuguanjun
     * @date 2021-11-05 11:43:28
     **/
    WelfareMovieOrderPayVo getPayMatchCardsByOrderId(Integer userId, Integer orderId, Integer cardSecretId);

    /**
     * 获取兔福宝电影订单支付信息
     * @param userId  用户id
     * @param orderId 订单id
     * @author liuguanjun
     * @date 2021-11-17 10:24:28
     **/
    WelfareMovieOrderPayVo getPayInfoByOrderId(Integer userId, Integer orderId);

    /**
     * 电影订单支付
     * @param user  用户对象
     * @param wlfareMovieOrderPayDto orderId 订单id
     * @param wlfareMovieOrderPayDto cardSecretId 卡密id
     * @param wlfareMovieOrderPayDto paymentAmount 需现金支付金额
     * @author liuguanjun
     * @date 2021-11-05 16:48:28
     **/
    Map saveMovieOrderToPay(WelfareUserWx user, WelfareMovieOrderPayDto wlfareMovieOrderPayDto) ;

    /**
     * 微信支付
     * @param orderId 订单id
     * @param openId       微信openId
     * @return java.util.Map
     * @author liuguanjun
     * @date 2021-11-11 09:41:28
     **/
     Map weChatPayForApplet(Integer orderId, String openId) throws Exception ;

    /**
     * 微信支付回调接口
     * @param request
     * @author liuguanjun
     * @date 2021-11-05 16:48:28
     **/
    String updateSettlementNotify(HttpServletRequest request) throws Exception;

    /**
     * 导出所有电影订单流水
     * @date 2021/11/5 9:57
     * @author caobucao
     * @param dataType 0平台端导出  1企业端导出
     * @return java.util.List<com.dzl.moive.pojo.vo.WelfareMovieOrderFlowVo>
     */
    void exportOrderFlowList(WelfareMovieOrderListQuery query, Integer dataType, HttpServletResponse res, HttpServletRequest req);

    /**
     * 获取订单详细信息
     * @author ChenLong
     * @date 2021-11-09 09:21:34
     * @param id 订单ID
     * @return com.dzl.moive.pojo.vo.WelfareMovieOrderInfoVo
     **/
    WelfareMovieOrderInfoVo getMovieOrderById(Integer id);

    /**
     * 订单退款
     * @param dto 退款订单
     * @return java.lang.Integer
     * @date 2021/5/31 16:48
     * @author caobucao
     */
    Integer updateRefundOrderForMovie(WelfareMovieOrderRefundDto dto);
}
